fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

interval

interval

interval(T:integer,from T,through option T,step T):Set T is[Module base][src]
A `from..through` interval with a given `step`.

This is a `Set T` and a `Sequence T` created by repeatedly adding `step` to `from`.
Stops before passing `through` (exceeding it for `step > 0`, falling below for `step < 0`).

Empty if `step` points away from `through`:
interval 1 2 -1 # empty: steps down, but through is up
interval 2 1 1 # empty: steps up, but through is down


A zero `step` is only allowed when `from = through`; such an interval
contains the single element `from`:
interval 5 5 0 # 5

If `through` is `nil`, the interval is unbounded and limited only by type `T` range.

This is not an interval in the mathematical sense, but rather a representation
of an arithmetic progression.
Precondition
pre
  debug: ((step.sign = 0): through = from)

Type Parameters

T:integer[Module base][src]

Fields

from T[Module base][src]
Start value. Included unless the interval is empty.
through option T[Module base][src]
Inclusive bound. Included only if reachable via `from + n * step`.
`nil` means unbounded.
step T[Module base][src]
Step size. Positive increments; negative decrements.

Functions

execute(env_vars option (container.Map String String),feed_stdin option io.path,timeout option time.duration) => outcome tokiwa.process_result[Inherited from  Sequence][src]
execute this Sequence of process+args
0.099dev (GIT hash e2d5298d8107bb5fe79600fdb06a49bc75756344)
last changed: 2026-11-23